import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path:'/',
    component:() =>import('@v/index.vue')
  },
  {
  path:'/login',
  component:() =>import('@v/Login.vue')
},

//后台管理布局
{
  path:'/layout' ,
  component:() =>import('@v/Layout.vue'),
  children:[{
    path:'role',
    component:()=>import('@v/role/Role.vue')
  },
  {
    path:'admin',
    component:()=>import('@v/admin/Admin.vue')
  },
]
},

{
path:'*',
component:()=>import('@v/Error404.vue')
},

]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router 